<!--
 * @Descripttion: 订单列表
 * @version:
 * @Author: lehaixia
 * @Date: 2022-10-27 20:06:44
 * @LastEditors: lehaixia
 * @LastEditTime: 2022-11-14 13:44:58
-->
<template>
  <div class="order-item" @click="jumpToDetail">
    <div class="item-head">
      <span class="i-code">{{ itemData.orderCode }}</span>
      <div class="i-confirm">{{ orderStatus }}</div>
    </div>
    <div class="people-box">
      <div class="p-name">
        <span class="name">{{ itemData.receiver }}</span>
        <!-- <template>
          <img v-if="itemData.sex===1" class="icon-sex" src="@/assets/img/sex-man.png">
          <img v-else class="icon-sex" src="@/assets/img/sex-man.png">
        </template> -->
      </div>
    </div>
    <div class="other-box">
      <div>联系电话: {{ itemData.receiverPhone }}</div>
      <div>接单号: {{ itemData.receiptNumber }}</div>
      <div>设计师: {{ itemData.designerName }}</div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'Item',
  components: {},
  props: {
    itemData: {
      type: Object,
      default: () => {}
    },
    orderStatusList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
    }
  },
  computed: {
    // 订单状态数据转换
    orderStatus() {
      const find = this.orderStatusList.find(v => v.dictCode === this.itemData.stage)
      return find && find.dictName || ''
    }
    // 跟进人
    // followUpUser() {
    //   const { followUpUserList = [] } = this.itemData
    //   const list = followUpUserList && followUpUserList.slice(0, 2).map(v => v.userTrueName) || []

    //   return list && list.join(',') || ''
    // }
  },
  watch: {},
  // 方法集合
  methods: {
    jumpToDetail() {
      const { id } = this.itemData
      this.$router.push({
        path: '/purOrder/detail',
        query: { id }
      })
    }
  }
}
</script>
<style lang='less' scoped>
.order-item {
  padding: 0 16px 16px;
  background: #FFFFFF;
  border-radius: 16px;
  margin-bottom: 16px;
  .item-head{
    position: relative;
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    &::after{
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 1px;
      background: #EFF2F7;
    }

    .i-code{
      font-size: 14px;
      color: #7D8091;
      font-weight: 400;
    }
    .i-confirm {
      background: rgba(22, 188,131, 0.1);
      border-radius: 6px;
      padding: 0 10px;
      font-size: 10px;
      font-weight: 500;
      color: #16BC83;
      line-height: 20px;
      height: 20px;
    }
  }

  .people-box{
    margin-top:16px;
    .p-name{
      height: 25px;
      display: flex;
      align-items: center;
      margin-bottom: 10px;
      align-items: center;

      .name{
        line-height: 25px;
        font-size: 18px;
        font-weight: bold;
        color: #111111;
      }

    }
    .icon-sex{
      width: 12px;
      height: 12px;
      margin-left: 6px;
    }
  }

  .other-box {
    font-size: 12px;
    font-weight: 400;
    color: #7D8091;
    line-height: 17px;
    &>div{
      margin-bottom: 6px;
      &:nth-last-of-type(1) {
        margin-bottom: 0;
      }
    }
  }
}
</style>
